package com.neusoft.neuiotms.dcom.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_inspection_task_project")
@org.hibernate.annotations.Table(appliesTo = "neuiot_inspection_task_project", comment = "巡检任务内容表")

public class InspectionTaskProject extends AbstractModel {

    private static final long serialVersionUID = 6236289293753131418L;

    @ManyToOne(targetEntity = InspectionTask.class, cascade = {CascadeType.ALL })
    private InspectionTask InspectionTask;

    //    @NotBlank(message = "项目类型")
    //    @Length(max = 255, message = "项目类型不能超过{max}位")
    //    @Column(length = 255, nullable = false)
    //    @Comment("varchar(255) NOT NULL COMMENT '项目类型'")
    //    private String projectType;

    @NotBlank(message = "位置code")
    @Length(max = 255, message = "位置code不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '位置code：待巡检的资产的位置'")
    private String locationCode;

    @NotBlank(message = "位置名称")
    @Length(max = 255, message = "位置名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '位置名称：待巡检的资产的位置名称'")
    private String locationName;

    //    @NotBlank(message = "类型code")
    //    @Length(max = 255, message = "类型code不能超过{max}位")
    //    @Column(length = 255, nullable = false)
    //    @Comment("varchar(255) NOT NULL COMMENT '类型code：待巡检的资产的类型'")
    //    private String typeCode;
    //
    //    @NotBlank(message = "类型名称")
    //    @Length(max = 255, message = "类型名称不能超过{max}位")
    //    @Column(length = 255, nullable = false)
    //    @Comment("varchar(255) NOT NULL COMMENT '类型名称：待巡检的资产的类型名称'")
    //    private String typeName;

    @NotBlank(message = "项目内容")
    @Length(max = 255, message = "项目内容不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '项目内容：待巡检的资产的id或者系统的id'")
    private String concreteCode;

    @NotBlank(message = "项目名称")
    @Length(max = 255, message = "项目名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '项目名称：待巡检的资产的名称或者系统的名称'")
    private String concreteName;

    @Column(length = 32, nullable = true)
    @Comment("int(32) NULL COMMENT '正常点数'")
    private Integer normal;

    @Column(length = 32, nullable = true)
    @Comment("int(32) NULL COMMENT '告警点数'")
    private Integer alarm;

    @Column(length = 32, nullable = true)
    @Comment("int(32) NULL COMMENT '预警点数'")
    private Integer earlyWarning;

    @Column(length = 32, nullable = true)
    @Comment("int(32) NULL COMMENT '未巡检点数'")
    private Integer uninspected;

    @OneToMany(mappedBy = "inspectionTaskProject", cascade = CascadeType.ALL)
    private List<InspectionTaskProjectItemValue> itemValue;

}
